package Crypto.xor;
import java.io.BufferedOutputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;

public class FileManipulation {
	/**
	 * Writes a image from a particular URL out to a location on the hard drive
	 * @param URL
	 * @param destination
	 * @throws IOException 
	 */
	public static void writeFileToDisk(byte[] data, String filename) throws IOException {
		OutputStream out = new BufferedOutputStream(new FileOutputStream(filename));
		
		// Now we will copy over the image byte by byte
		for(int i = 0; i < data.length; i++) {
			out.write(data[i]);
		}
		
		// close our input and output streams
		out.close();
	}
}
